<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>$vo['name']))}
	<div class="operate-panel">
		<a onclick="go_return_url();" class="btn">返回</a>
		<if condition="$auth->admin">
			<a onclick="del()"class="btn btn-del">删除</a>
		</if>
		<div class="split"></div>
		<a onclick="winprint()" class="btn  hidden-xs">打印</a>
		<if condition="$auth->write">
			<a onclick="edit();" class="btn">修改</a>
		</if>
	</div>
	<form method='post' id="form_content" name="form_content" enctype="multipart/form-data"   >
		<input type="hidden" id="id" name="id" value="{$vo.id}">
		
			<label class="input-label" >标题：</label>
			
				<p class="input-static">
					{$vo.name}
				</p>
			</div>
		</div>
		
			<label class="input-label" >编号：</label>
			
				<p class="input-static">
					{$vo.doc_no}
				</p>
			</div>
		</div>
		
			<label class="input-label" >登录人：</label>
			
				<p class="input-static">
					{$vo.user_name}
				</p>
			</div>
		</div>
		
			<label class="input-label" >登录日期：</label>
			
				<p class="input-static">
					{$vo.create_time|to_date='Y年m月d日 H:i'}
				</p>
			</div>
		</div>
		<foreach name="field_list" val="field_vo">
			{:widget('UserDefineField/view',array($field_vo))}
		</foreach>
		<div class=""></div>
		
			
				<div class="content_wrap" >
					{$vo.content}
				</div>
			</div>
		</div>
		
			<label class="input-label" for="name">附件：</label>
			
				{:widget('file_upload/view',array('add_file'=>$vo['add_file'],'mode'=>'show'))}
			</div>
		</div>
	</form>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use('global', function() {
			var $ = layui.jquery;
			$("#btn_del").on('click', function() {
				layer.msg('确定要删除吗?', {
					time : 0,
					btn : ['确定', '取消'],
					yes : function() {
						send_ajax("{:url('del')}", 'id=' + $("#id").val(), function(data) {
							if (data.status) {
								layer.msg(data.info, function() {
									go_return_url();
								});
							}
						});
					},
					no : function(index) {
						layer.close(index);
					}
				});
			});
		});

		function edit() {
			window.open(fix_url("{:url('edit')}?id=" + $("#id").val()), "_self");
		}
	</script>
</block>